package com.example.net.okhttp.inerceptor;

import androidx.annotation.NonNull;

import java.io.IOException;

import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;

/**
 * create by Test on 2024/4/11 Time：15:55
 * describe:
 */
public class AuthInterceptor implements Interceptor {
    @NonNull
    @Override
    public Response intercept(@NonNull Chain chain) throws IOException {
        Request originRequest =  chain.request();
        Request newRequest = originRequest.newBuilder()
                .addHeader("author","hi_man_interceptor")
                .build();
        return chain.proceed(newRequest);
    }
}
